import emitter from "../utils/events";
import Measure from "../components/measure";
import UserList from "../components/UserList";

import useSystemStore from "../store/system";

export default function LocalMain() {
  const { curRoute } = useSystemStore((state) => state);

  emitter.on("login_success", () => {
    console.log("登录成功");
  });
  emitter.on("logout_success", () => {
    console.log("退出成功");
  });

  return (
    <div className="w-full h-full relative bg-black">
      {curRoute == "home" ? (
        <Measure isCanvasInitialized={curRoute == "home"} />
      ) : null}
      {curRoute == "user" ? <UserList status={curRoute == "user"} /> : null}
    </div>
  );
}
